package com.baseframe.sms.utils;

import java.util.Random;

public class VariableUtil {

    private static final Random RANDOM = new Random();
    private static final String[] NUMBER_ARRAY = {"0","1","2","3","4","5","6","7","8","9"};



    public static String randomCode(int length){

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i <length ; i++) {
            int next = RANDOM.nextInt(NUMBER_ARRAY.length);
            sb.append(NUMBER_ARRAY[next]);
        }

        return sb.toString();
    }

    public static void main(String[] args) {

        for (int i = 0; i < 1000; i++) {
            System.out.println(randomCode(6));
        }

    }


    /**
     * 根据变量名获取值
     * @param variableKey
     * @return
     */
    public static String getVariableValue(String variableKey){


        return null;
    }

}
